package Ontologies;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: jiaka_000
 * Date: 13-5-18
 * Time: 下午2:49
 * a Entity class to record transaction
 */
public class Transaction {
    /**
     *  the tree sold or bought
     */
    private TreeWithPrice tree;

    /**
     *  the buyer who bought this tree
     */
    private String buyerName;
    /**
     *  the seller who sold this tree
     */
    private String sellerName;
    /**
     *  when this transaction occur
     */
    private Date transactionDate;

    public TreeWithPrice getTree() {
        return tree;
    }

    public void setTree(TreeWithPrice tree) {
        this.tree = tree;
    }

    public String getBuyerName() {
        return buyerName;
    }

    public void setBuyerName(String buyerName) {
        this.buyerName = buyerName;
    }

    public String getSellerName() {
        return sellerName;
    }

    public void setSellerName(String sellerName) {
        this.sellerName = sellerName;
    }

    public Date getTransactionDate() {
        return transactionDate;
    }

    public void setTransactionDate(Date transactionDate) {
        this.transactionDate = transactionDate;
    }

    /**
     * the constructor with all fields
     * @param tree: the tree sold or bought
     * @param buyerName: the buyer who bought this tree
     * @param sellerName: the seller who sold this tree
     * @param transactionDate: when this transaction occur
     */
    public Transaction(TreeWithPrice tree, String buyerName, String sellerName, Date transactionDate) {

        this.tree = tree;
        this.buyerName = buyerName;
        this.sellerName = sellerName;
        this.transactionDate = transactionDate;
    }

    /**
     * the default constructor
     */
    public Transaction() {

    }
}
